Thanks Carlos, I tried that but initally encountered expectations of placeholders, as in Text Date syntax.
The context is as follows.
- This is from a SharePoint list.
- It is a New Form that creates service codes.
- A simple concatenate together with the SharePoint Item ID, is simple.
- the elements that form part of the Concatenate are pulled from multiple lists, but am having trouble getting the ID, as it is autogenerated.
- Below are some methods I had to reach that point.
Example service code
SC-KBCE-ABA-66
[SC-][CompanyABBR-][ServiceType-]-[ID]
The method I added a Confirm Save step with a button so I could get the ID from the SharePoint list visible in a Text field. Then I would patch, if confirmed. WORKS
Patch('Service Code',GalleryServiceCodes.Selected,{Title:Concatenate("SC-",LookUp(RegisteredClientsCollection,Company=DataCardValue7.Selected.Value,ShortCode),"-",LookUp(ServiceTypesCollection,DataCardValue75.Selected.Value=Title,ShortCode),"-", DataCardValue29.Text)});UpdateContext({ServiceCodesDisplayFormVisible:false,ServiceCodesGalleryVisible:true,ServiceCodesEditFormVisible:false,ServiceCodesSaveConfirmationVisible:false,NewServiceCode:false});ClearCollect(ServiceCodesCollection,'Service Code')
My actual wish was to patch on the first save, but Text(ID) on its own isn't recognised.
Patch('Service Code',GalleryServiceCodes.Selected,{Title:Concatenate("SC-",LookUp(RegisteredClientsCollection,Company=DataCardValue7.Selected.Value,ShortCode),"-",LookUp(ServiceTypesCollection,DataCardValue75.Selected.Value=Title,ShortCode),"-", Text(ID))});UpdateContext({ServiceCodesDisplayFormVisible:false,ServiceCodesGalleryVisible:true,ServiceCodesEditFormVisible:false,ServiceCodesSaveConfirmationVisible:false,NewServiceCode:false});ClearCollect(ServiceCodesCollection,'Service Code')
I tried to add specificity, but was wondering as Patch already was specific about which record I'm refering to in 'GalleryServiceCodes.Selected'. My new more specific code does work, but only on confirmation step, not in one step as in a New Form.
Patch('Service Code',GalleryServiceCodes.Selected,{Title:Concatenate("SC-",LookUp(RegisteredClientsCollection,Company=DataCardValue7.Selected.Value,ShortCode),"-",LookUp(ServiceTypesCollection,DataCardValue75.Selected.Value=Title,ShortCode),"-", ID)});UpdateContext({ServiceCodesDisplayFormVisible:false,ServiceCodesGalleryVisible:true,ServiceCodesEditFormVisible:false,ServiceCodesSaveConfirmationVisible:false,NewServiceCode:false});ClearCollect(ServiceCodesCollection,'Service Code')