Hi everyone,
I have a PowerApps form created from a SharePoint list. The requirement is:
Could anyone advise?
Best regards,
Solved! Go to Solution.
You could add a "Save as New" button on the form and use the Patch() to create the new item in SharePoint. Along with the Patch() you would need to reset the form and close it.
Example formula for the button:
Patch('SPOListName', Defaults('SPOListName'), {SPOFieldName1:CopyValue1 , SPOFieldName2:CopyValue2, ...});
ResetForm(SharePointForm1);
RequestHide()
You will need to call out each field that you are going to set in the new record in the {....} of the Patch().
You could add a "Save as New" button on the form and use the Patch() to create the new item in SharePoint. Along with the Patch() you would need to reset the form and close it.
Example formula for the button:
Patch('SPOListName', Defaults('SPOListName'), {SPOFieldName1:CopyValue1 , SPOFieldName2:CopyValue2, ...});
ResetForm(SharePointForm1);
RequestHide()
You will need to call out each field that you are going to set in the new record in the {....} of the Patch().
Thank you so much for this and for your prompt response. Working exactly as instructed.
When I copy an existing record and save as new item, the existing values on that form don't appear in the Sharepoint under the new item - only the changed values appear there.
How can I fix this? I set the clone to be a new form to differentiate it from the edit. CFSC Forecasting Tool is the name of my Sharepoint list and there are a few cascading dropdowns hence why I have used @odata.type'
This is my code:
If(New=true,
Patch(
'CFSC Forecasting Tool',
Defaults('CFSC Forecasting Tool'),
{
Title:DataCardValue6.Text,
CDT:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:filterCDT},
Banner:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:filterBanner},
Category:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:filterCategory},
StartDate:DataCardValue12.SelectedDate,
EndDate:DataCardValue13.SelectedDate,
PromoCreatedBy:DataCardValue11.Selected,
Status: DataCardValue34.Selected,
Comments:DataCardValue39.Text
}
),
Patch(
'CFSC Forecasting Tool',
LookUp('CFSC Forecasting Tool', ID=DataCardValue10.Text),
{
Title:DataCardValue6.Text,
CDT:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:filterCDT},
Banner:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:filterBanner},
Category:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:filterCategory},
StartDate:DataCardValue12.SelectedDate,
EndDate:DataCardValue13.SelectedDate,
PromoCreatedBy:DataCardValue11.Selected,
Status: DataCardValue34.Selected,
Comments:DataCardValue39.Text
}
)
);
ResetForm(EditForm1);Back()
I have a 'copy' button with Onselect property set to: EditForm(EditForm1)
This will pull in all of the existing data.
Then I created a PowerAutomate to create a new item in the SharePoint list. In the form fields, I set those to "Ask in PowerApps"
Then on your "submit" button, connect your flow and add the text input values as shown in your flow.
I was trying to replicate your idea (it was quite genius)... but when I am trying to select the dynamic content to my sharepoint list, I only get back "Title", none of the other columns will show.
did you do something else??
Hi Fernanda - You need to click on "See More" and then scroll down to the bottom to "Ask in PowerApps"
haha thanks! now i feel kinda stupid hahaha I actually figured it out later. But then I encountered other problem. The button is giving me a hard time with the date field. I actually posted my issue:
Been trying to work it out, but not sure what my problem is, tried all combinations possible... just take the link as it is (like you have it), formatting it, dateformat to string, variables, split formula, and so on...
This is working for me as well, but if I have more than 100 fields is there away to get them all once instead of typing them 1 after 1 on the item property ?
Thanks
Almog
Any one could help me on my question on how should I perform a copy for more than 100 values? is there a way to gather them all somehow?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
208 | |
97 | |
60 | |
54 | |
52 |
User | Count |
---|---|
257 | |
158 | |
87 | |
79 | |
65 |