This topic contains 15 replies, has 3 voices, and was last updated by  admin 5 years, 9 months ago.

  • Author
    Posts
  • #74997

    Justin Close

    Hi again,

    I’m working with fmGateway.  I was hoping you could give me a bit of guidance.  I’m trying to do an fmGateway ‘Find records’ action, based on a TimeStamp field.  Ultimately, I’m looking to find records that were modified in the past hour, and send a Slack message for each of those records found.

    I set up a Zapier Date/Time step to get the current timestamp, subtract an hour and format it as “MM/DD/YYYY H:mm:s”.  That seems to work.  But when I build the fmGateway Find routine and define the criteria for the find as this (not sure if this image will come through):

    fmGateway Find criteria

    … and run the test, it is returning me records that don’t have any value defined in the Z_StatusModifiedTS field.  (I think it’s returning all records because the sample record I get back is the first one in the table.)  “Step 3” in this example is the Zapier Date Formatting step.  The test data there is the output of my formatting.

    I have also tried hard-coding in various search strings into the Zapier fmGateway definition field, but that seems to get the same results.

    Thanks,

    Justin

  • #74998

    JustinC
    Participant

    Trying again with the screenshot of my Zapier Find request field definition.

    Attachments:
    You must be logged in to view attached files.
  • #75000

    JustinC
    Participant

    I did some further testing.  I am able to query my DB directly via the DataAPI (using Postman) with this query criteria:

    {“z_StatusModifiedTS”: “>=06/14/2018 09:10:00”}

    But when I try this string in the “z_StatusModifiedTS” configuration field of the fmGateway Zap…

    >=06/14/2018 09:10:00

    …the test record returned is the first one in the table and does not match the Find criteria.  (When I put quotes around it, it was giving me an error.)

    Is this just an artifact of the Zap test step – it’s not really fully running the query?

    I’ve enabled the Zap and will see if things work as hoped; it should run in about 15 minutes.

  • #75001

    JustinC
    Participant

    Well, it’s probably not an issue of just being done in the test sandbox – when I run this Zap from the dashboard (or when it ran automatically) it also only gave me information from the first record in the table – which shouldn’t have been returned by the Find query.

    So that seems to leave fmGateway as the only remaining variable.  I’m pretty sure that I have configured things correctly in the Zapier config page for the Find query…

  • #75002

    admin
    Keymaster

    Hi Justin –

    There was in fact an error in how searches were performed.

    We just fixed it and resubmitted the app. Thanks for troubleshooting it – I hope it wasn’t terribly inconvenient. This was a new feature we just added to the app and apparently didn’t work out all the kinks.

    I expect the new version to be up within 24 hrs – they’re usually pretty quick about updating it.

  • #75003

    JustinC
    Participant

    Cool!  Glad there was a specific issue.  I’ll keep testing it an see how it goes.  (I don’t suppose that there’s anyway for me to explicitly test/see what version of fmGateway I’m getting?)

  • #75004

    admin
    Keymaster

    I’m afraid I don’t have an answer for that. Sorry!

  • #75005

    JustinC
    Participant

    Woot!  It looks like it has already been updated.  When I tested it I got one of the records that I expected.  Excellent!

    As a side note – do you have any tips for getting the Zap to iterate over multiple records returned from this Find?  I’ve just started looking into it.

    • This reply was modified 5 years, 9 months ago by  JustinC.
  • #75007

    JustinC
    Participant

    I haven’t found a Zapier specific looping construct.  But curiously, using the fmGateway ‘New Records’ action, I do get separate messages for each new record that it found.  I’m testing that with a ‘Find’ operation.  (Up to now, I haven’t gotten multiple messages as a result of multiple found records.)

  • #75008

    admin
    Keymaster

    Sorry, Justin. You lost me.

  • #75009

    JustinC
    Participant

    When I set up a Zap using fmGateway’s ‘New Records’ step, it did send a separate Slack message for each new record that it found.

    I have not been able to find a specific Zapier ‘app’/action that would explicitly loop over the results from a previous Step and feed those results into a different Step, one at a time.

    <span style=”caret-color: #000000; color: #000000; font-family: -webkit-standard; font-size: medium;”>In my original testing, if my Find step (using fmGateway) returned multiple records, a follow-on Action step (e.g. send Slack direct message), would only send 1 message.  I would like it to send a separate message, 1 per each record found, using data from within each record of the found set.</span>

  • #75010

    admin
    Keymaster

    Typically the way Zapier works is it runs the action for each record returned. So you don’t need to explicitly loop over anything.

    There was an error in the old search method so only one record (and the wrong record at that) was returned. It should work as expected now.

  • #75013

    JustinC
    Participant

    Do you know if that behavior, running the ‘action’ for every record, only applies to the Trigger event’s records?

    When I do a Schedule -> fmGateway Find -> Slack DM   Zap I’m only getting 1 message.  When I test the same Find query using Postman, I get 6 records back from the Data API.  So I would assume that the fmGateway Find results in the same record count.  Unfortunately I’m only getting 1 Slack message out of it.

    Here’s the outline of the Zap (attached).

     

     

    Attachments:
    You must be logged in to view attached files.
  • #75015

    admin
    Keymaster

    Justin – you are so right!

    The search mechanism from Zapier was intended to find a specific record to fill in details during a workflow – not to trigger as new records are created. I apologize for the confusion.

    We added a new TRIGGER to perform an action when new records match your request. Give that a shot and let me know how it works for you.

    Thanks

    Attachments:
    You must be logged in to view attached files.
  • #75017

    JustinC
    Participant

    I haven’t been able to test it yet – but is there a way to just do a straight up Find as the ‘Trigger’?  That is, a Find that doesn’t also require that it be ‘new’?

    The goal I was attempting to achieve was to find records that had been modified within a certain time frame (e.g. the past hour).  If I can only search amongst ‘new’ records, then that excludes records that were simply modified, of course.

  • #75019

    admin
    Keymaster

    It may require some testing and some tweaking.

    Typically, Zapier does remember records it’s already “seen” as part of that Zap. So if the record has already been processed, Zapier will probably ignore it. So if you want to re-process records that were modified again, I’m not sure if that will work – I’d love to hear your test results though.

    I can look to see if there’s a way around that. Right now we’re keying on FileMaker’s built-in record id. Perhaps allowing you to define your own record ID field would allow you to re-process existing records. It’s something we were considering.

     

You must be logged in to reply to this topic.