cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Complex Record Update and Search

Greetings. This is a rather complex question and I'll do the best I can to explain the desired outcome. Here's the scenario:

 

An employee comes on shift. They conduct an inventory check for items that are either located in BOX1, BOX 2, or BOTH. The inventory, the location, the employees on and off shift, and all the items that are there are then written to an SQL table. Upon completion of the inspection, a record is added, an email is sent to the manager and the data is used to create a document in Word.

 

 I am using the following:

 

1. SQL Table (Azure)

2. 1 Screen

 

For the SORT GALLERY function, would the following work?

SortByColumns(
    Search('LocationName', SearchInput.text, "Box1")

For Submit All Fields, would the Patch function be the correct method? I have this particular formula:

Patch((Location & Box(SELECTED) OnComingEmployee & OffcomingEmployee & GalleryItems & UserSubmitting, CheckTable,ChangeRecord))   

InventoryCheck.jpgAny help would be appreciated.

 

 

5 REPLIES 5
Community Support Team
Community Support Team

Re: Complex Record Update and Search

Hi BrendonBrooksP1,


About Sort/SortByColumn columns, please check this documentation for a reference:
https://powerapps.microsoft.com/en-us/tutorials/function-sort/

 

According to this documentation, we know that Sort function sorts a table based on a formula, while SortByColumns sorts a table based on one or more columns.


If you are trying to use SortByColumns, please try to configure the Items property of a Gallery as e.g.
Sort(Search(ListB,TextInput1.Text,"Title"),Date)

 

About Patch function, please check this documentation for more details:
https://powerapps.microsoft.com/en-us/tutorials/function-patch/

 

We can use Patch function to create or modify one or more records in a data source.

 

I create a simple app to use Patch function to submit data to data source, I configure the OnSelect property of a Button as following.


when the button is clicked, I can patch the data to data source, and also send an email.

Patch(ListB,Defaults(ListB),{Title:TextInput1.Text});Office365.SendEmail(User().Email,"subject","body")

 1.png

 

Hope my simple scenario could be a reference for you. Please feel free reply if you need more help.


And about uploading file to SharePoint, it has not been supported yet, so we are not able to upload file from PowerApps to data source currently.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: Complex Record Update and Search

Thank you Mabel for the example. Am I able to Patch data that is in a gallery to a SQL table?

Community Support Team
Community Support Team

Re: Complex Record Update and Search

Hi BrendonBrooksP1,

 

Yes, we are also able to Patch data to SQL table.


The formula configuration should be the same.


Please try it on your side.


If you have any problems with it, please feel free reply.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: Complex Record Update and Search

Mabel,

 

I have been able to Patch everything but the data that is in the gallery when the data is filtered. Would I have to Collect that data and then Patch it?

 

Community Support Team
Community Support Team

Re: Complex Record Update and Search

Hi BrendonBrooksP1,

 

If you want to patch all the filtered data to data source, save the data to a Collection first then patch it would be a good choice.

 

And I guess this thread about “Patch a Collection” could be a reference for you:
https://powerusers.microsoft.com/t5/PowerApps-Forum/Patch-a-Collection/td-p/9329


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,828)