Production Workflow

 View Only

AP Election API in DataLinq

  • 1.  AP Election API in DataLinq

    Posted 09-09-2022 00:35
    [EDITED -- found the answer in page 18 or so of my search results; since I can't seem to delete this post, I'll just put the answer below for anyone who ever searches this]

    This is the first race result for Tueday's RI primary.
    I have the following test data from AP's API (this is a partial XML below):

    <Race Test="1" ResultsType="t" ID="40006" EventID="RI0220913_CT20220908" OfficeName="Governor" Party="GOP"/>

    I set a DataLinq Key named Election_ID to the race as it is numerically sorted (in this case, this is the first race in my query, so it's 1) and use it to get data from the API just fine. So to get the office name of the race, I have:

    Race<%Election_ID%>\ReportingUnit\OfficeName
    No problem. Everything works. And I can finish the mission like this, stepping through the series of results I need.
    However. My brain isn't happy. I feel like there has to be a way to use the ID of 40006 (the election board's ID number for the race) to retrieve the data instead. 
    --------------------
    And the answer I found is this:

    By putting 40006 in the Datalinq Key, it returns the OfficeName for just that race ID. 
    That is... SUPER simple once you know. But it stopped me cold for quite a while. 
    This is what happens when you send a VFX artist to program your XPression...