Hi All,
I am trying to create an app for offline mode. My scenario is -
I am saving data into collection in ofline and when online patching data to source. Also triggering a flow. Now what I want is - I want to before triggering a flow I want to check if temperature >=38. If yes then trigger a flow else not.
How can I do that?
I tried using if(cre08_temperature>=38,....,....) but it is showing me error "Name isn't valid "
On app OnStart i have below code-
If(
!IsEmpty(TriagebyBusCollection.cre08_temperature) && Connection.Connected,
ForAll(
TriagebyBusCollection,
Patch(
'Triage daily Replicas',
Defaults('Triage daily Replicas'),
{
Temperature: cre08_temperature,
Cough : cre08_othersymptoms,
'Seat Number Dummy':cre08_seatnumberdummy
}
)
);
//here i want to check if temperature >=38
ForAll(
TriagebyBusCollection,
PowerAppsbutton.Run( cre08_temperature));
);
I recommend using an automated flow rather than calling the flow from your app.
It looks like your connection is CDS based on the field name in your question (if not see below). if you are using cds, you can do this in your flow trigger and not call the flow from the app at all.
create a flow from a solution
use the common data service current environment connector
choose the trigger when a record is created, updated or deleted
set the trigger condition to create, select your entity, and organization for scope
In the filter expression, add an odata query expression for your condition. it would be something like
cre08_temperature GT 38
You might need to put single quotes around the 38.
this will make the flow only run when a record is created with a temperature greater than 38--even if the record is patched after being offline
If your source is SharePoint or some other source, have your flow triggered when an item is added, then add a check condition step to check for the condition.
you cannot mix conditional flow calling in the patch formula. My approach is better because it is more dependable and does not require sharinig the flow or flow ownership with the app users. and it runs dependably if the user is connected online or patching after being offline.
@Anonymous if this answers your question, please mark it a solution.
WarrenBelz
223
Most Valuable Professional
MS.Ragavendar
110
stampcoin
86