I have two data sources:
AccidentReport = this is a new form and is completed whenever someone has an accident at work. One of the columns in this data source is called “BeenInvestigated”, which is set to false by default.
InvestigateReport = This is a new form and is completed whenever an Investigator decides to looks into the submitted accidents from the AccidentReport list.
When an accident has been reported, it appears in this dropdown to be investigated:
This is the dropdown’s items property:
I would like to know how to remove the AccidentID from this dropdown, as soon as the InvestigateReport form has been submitted. For example, if AccidentID 38 has been investigated and sent to InvestigateReport as a new entry, I would like 38 to disappear from this dropdown.
It would be great if I could update BeenInvestigated in the AccidentReport to true for that record when the corresponding InvestigateReport form has been submitted, but if there is a better way to do this, I’d be happy to hear about it.
Solved! Go to Solution.
Hi @VINdicated09 :
I suggest you add a formula after SubmitForm().
Patch(AccidentReport,
LookUp((AccidentReport,AddidentID=dropdown.Selected.AccidentID),/*Find the corresponding record in AccidentReport*/
{BeenSubmitted:true})/*Update the value of BeenSubmitted to true*/
Because the value of BeenSubmitted for the specified record is no longer false, this option will no longer appear according to the filter conditions in dropdown.
Best Regards,
Bof
You will want to use Patch function. I recommend Shane Young
I have already used Patch and have followed along with his video. Though I was able to get it to work, my solution isn't great. Below, you can see that my submit button, is actually within a gallery, with all the other elements in that gallery set to visible=false!
Is there a better way to do this or a way where I can have this button outside of the gallery?
Can someone please help rather than just telling me to search for a video
Hi @VINdicated09 :
I suggest you add a formula after SubmitForm().
Patch(AccidentReport,
LookUp((AccidentReport,AddidentID=dropdown.Selected.AccidentID),/*Find the corresponding record in AccidentReport*/
{BeenSubmitted:true})/*Update the value of BeenSubmitted to true*/
Because the value of BeenSubmitted for the specified record is no longer false, this option will no longer appear according to the filter conditions in dropdown.
Best Regards,
Bof
Move your patch and navigate to onsuccess of the form.
I would set(JustSubmitted, ThisItem) so you can call it easily.
After rereading this: __I would like to know how to remove the AccidentID from this dropdown, as soon as the InvestigateReport form has been submitted. For example, if AccidentID 38 has been investigated and sent to InvestigateReport as a new entry, I would like 38 to disappear from this dropdown.
If patch is working properly, you just need to refresh the dropdown datasource.
Thank you so much. This has worked for me.