Workforce Editing Workers Table Via REST API and integromat

722
3
06-03-2020 09:26 AM
PaulSweeney3
Occasional Contributor III

I have a workers table  as part of a workforce project that i have added fields to and i use integromat to update each field following the submisison of a survey123 form as required. I thought it was working fine until i noticed that some of the edits are not sticking despite a successful result being returned. is there a reason that a workers table might not take these edits. i was wondering if it may be something to do with the fact its the workers table and it is constantly updating that perhaps there may be some conflict with any attempts i am making in addition to it. Is the workers table not a reliable table to use for additional information that needs regular updates with this method. 

3 Replies
CraigGillgrass
Esri Regular Contributor

Paul,

We don't usually hear of users adding extra fields to the Workers layer and updating the fields in this manner.  Can you go into some details on the use case and what information you're storing in the fields?  I can't recall a scenario like this before, all cases of adding other fields are for the Assignments layer.

Workforce mobile app does update the Workers layer at regular intervals to record the Worker's location changing and their active state.

Craig

0 Kudos
PaulSweeney3
Occasional Contributor III

Hi Craig 

I have added some additional fields in order to record some items of stock individual workers have on board their vehicles in integer fields.  The idea was to reduce the quantity by a certain amount when work was complete and monitor their stock levels. The integromat runs and it appeared to be working however i noticed discrepancies in the values so i went through the integromat history and viewed the results. The scenario shows a successful update where the stock has been reduced  by 1 item and the correct values passed through, but in the next scenario it appears as if the value has been reset and the previous scenario did not work as expected. this does not happen every-time it just seems to happen occasionally, most of the time it works. 

First Scenario shows item 2 at 21 

Integromat shows succesful update with reduction of 21 to 20 

Next scenario shows ITEM 2 at 21 again 

0 Kudos
Jesse
by
New Contributor III

FWIW I'm running into something similar on the Assignments layer. I'm trying to update the Priority field with a score calculated from a Survey123 form, and I'm using Microsoft Power Automate. I've tested extensively and pinpointed the issue to conflicting edits. The workflow to reproduce is:

  1. Mobile worker is editing in offline mode
  2. The mobile worker submits the survey and initiates the Power Automate flow
  3. Power Automate posts the new Priority to the assignment
  4. Mobile worker "finishes" the assignment or otherwise makes edits
  5. Mobile worker syncs edits
  6. The assignment loses the Power Automate edits but retains the mobile worker's edits.

Something similar happens when the Power Automate flow runs while a dispatcher is editing.

My ideas are that:

  1. You somehow delay the flow from running instantaneously
  2. You run a script overnight that updates those values for the next day
  3. You figure out a way to check whether a feature is being edited, and make the flow wait to post its update until the feature is no longer being edited.

There must be a way to do idea 3, because the dispatcher side has the edit button disabled when mobile workers are actively editing:Screen Shot 2022-01-25 at 2.21.27 PM.png

 

Maybe this illuminates something for you or ESRI...

0 Kudos