I created the below command on a submit button of the app I am working on, in which, it calls a power automate to create a file on the document library, as well as patches a new item in sharepoint list. I am trying set the ID of the created file to a variable and update the sharepoint list with that variable in a column titled applogoID. However, I received the error of (JSON parsing error, expected number but got string).
// Upload file to SharePoint
AppRegUploadFileToSharePoint.Run({
file: {
name: First(Attach_AppDisplayImage.Attachments).Name,
contentBytes: First(Attach_AppDisplayImage.Attachments).Value
}
});
// Set variable to capture the ID of the uploaded file
Set(varFileID, Value(AppRegUploadFileToSharePoint.Run({file:{name: First(Attach_AppDisplayImage.Attachments).Name, contentBytes: First(Attach_AppDisplayImage.Attachments).Value}}).id));
// Convert varFileID to a number
Set(varFileID, Value(varFileID));
// Patch App Details
Patch(
'NPA-NIWC PAC Apps',
Defaults('NPA-NIWC PAC Apps'),
AppReg_Form.Updates,
{AppLogoID: Value(varFileID)
}
);
NotificationType.Success;
Navigate(HM_Screen, ScreenTransition.Fade)