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

Manually trigger a flow when new record is added

1)Start From the Manually trigger flow  then Get Rows of sql Table (student). And also get MySql table last row id.

2)Then Get Items of sharepoint list table( student) . And also get the last row id of the list.

3)then compare row Sql table id with sharepoint list id if it is equal then do nothing. if  Sql table id >(is greater than) sharepoint list id  then no of rows to add .

4)then have to do a loop for each and get the values of the list from the table for id and write those values to the sharepoint list


Please help. Thanks in advance.

3 REPLIES 3
Community Support
Community Support

Hi @ganesan_gowri :

I’m not sure what your needs are,could you tell me:

  • In what environment are you currently operating? Canvas app? or power automate?
  • What is the logic of this flow?Search for records that not in SP list but in SQL and add them to SP list?(I don't quite understand the meaning of the third and fourth steps you mentioned)

I assume you are builting a canvas app and the logic that i mentioned is correct.

add a button:

OnSelect:

 

ForAll(Filter(SQLTable,!(ID in SPlist.ID)),Patch(SPlist,Defaults(SPlist),{field2:SQLTablefield2,field3:SQLTablefield3,field4:SQLTablefield4})

 

Iterate through all the records in the SQLTable whose ID is not in the SP list, and add them to the SP list as new records.

If my understanding is incorrect. Could you provide more detailed information?

In addition,If you want to ask questions about Power automate, here is the link.

Best Regards,

Bof

currently i am working in powerapps canvas app. And i have a button to patch the newly created record to the sharepoint list (Master_List)Table.

So i have a Table of (Employee_List) for a specific dropdown as a datasource in user entry screen. it has a record that i get values from this to my dropdowns.

 

 When the user creates a new incident it patch to the Master_List (Sharepoint). And here i am using flow automate to patch the newly saved records from sharepoint to MySql. this was running quite good.

 

Now again i need another one flow That was a Manually trigger flow . Scope of this is when a new entry or records creates in Sql table of (Employee_list) then run the flow to add the new users entry in to the sharepoint list (Employee_List) Depending upon comparing the ID's of Sql and Sharepoint. if it is equal then do nothing. if table id >(is greater than) sharepoint list id
then no of rows to the sharepoint list. then have to do a loop for each and get the values of the list from the table for id(for example if id id 51 means want to insert that specific record ) and write the values to the sharepoint list. 

 

I have done Created the flow. About flow is running but its doesn't show the needs that i want.

 

In flow i give SQL GET ROWS (Employee_List)

                     Sharepoint GET Items(Employee_List)

 

 Will you please refer the flow and do changes as according my needs

 

myflow.png

Hi @ganesan_gowri :

If there is a problem with my understanding, please help me point it out:
If the ID of the last record of the sql table is less than the ID of the last record of the SP list, add all the records of the SQL table to the SPlist.

If my understanding is correct, then you can solve the problem without using flow.

Just add a button and set it's OnSelect property to:

 

If(Last(SQLTable).ID<Last(SPlist).ID,
   ForAll(SQLTable,
      Patch(SPlist,
            Defaults(SPlist),
            {field2:SQLTablefield2,field3:SQLTablefield3,field4:SQLTablefield4}
            )
           )
 )

 

In addition, If you want to trigger flow in power app, the flow must use powerapp trigger.

Best Reagards,

Bof

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (53,186)