web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch and Flow Form Da...
Power Apps
Answered

Patch and Flow Form Data to SP List / Library

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Can anyone help me hack through the following. I tried it and got a bunch of red. Any thoughts about where I'm off?

 

I have List and a Library. I tried to mimic what I've 'successfully' done for up such applications. This one I can't seem to figure out.

 

Patch('Fire and Life Safety System Annual Inspection List', Defaults('Fire and Life Safety System Annual Inspection List'),
{AssetID:FLSAssetIDDataCardValue.Text,
AssetDescription:FLSAssetDescriptionDataCardValue30.Text,
LocationID:FLSLocationIDDataCardValue27.Text,
LocationDescription:FLSLocationDescriptionDataCardValue28.Text,
Comments:FLSDefCommentsDataCardValue29.Text,
QuestionNo:QuestionNoDataCardValue26.Text,
DateofInspection:FLSLastInsepctionDataCardValue.SelectedDate});

Set(varDemoFromAttachControl, JSON(UploadAssistImageControl.Image, IgnoreBinaryData));


Set(varBase64Only, Mid(varDemoFromAttachControl, Find(",", varDemoFromAttachControl+1, Len(varDemoFromAttachControl) - Find(",", varDemoFromAttachControl)-1));


Set(
varFileLink,
FireandLifeSafetySystemAnnualInspectionUploaderFlow.Run(
FandLSITMUploadFormGallery.Updates.Park &
FandLSITMUploadFormGallery.Updates.AssetID &
FandLSITMUploadFormGallery.Updates.DateofInspection,
varBase64Only).sharepointfilelink);

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,279 Most Valuable Professional on at

    @Anonymous ,

    You are missing a closing bracket on this one

    Set(
     varBase64Only, 
     Mid(
     varDemoFromAttachControl, 
     Find(",",
     varDemoFromAttachControl+1, 
     Len(varDemoFromAttachControl) - 
     Find(
     ",", 
     varDemoFromAttachControl
     )-1
     )
     );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Made the update. No apparent change.

     

    I'm getting the following error messages when I hover on the formula:

         1. Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

         2. The function 'Mid' has some invalid arguments.

     

    Patch('Fire and Life Safety System Annual Inspection List', Defaults('Fire and Life Safety System Annual Inspection List'),
    {AssetID:FLSAssetIDDataCardValue.Text,
    AssetDescription:FLSAssetDescriptionDataCardValue30.Text,
    LocationID:FLSLocationIDDataCardValue27.Text,
    LocationDescription:FLSLocationDescriptionDataCardValue28.Text,
    Comments:FLSDefCommentsDataCardValue29.Text,
    QuestionNo:QuestionNoDataCardValue26.Text,
    DateofInspection:FLSLastInsepctionDataCardValue.SelectedDate});

    Set(varDemoFromAttachControl, JSON(UploadAssistImageControl.Image, IgnoreBinaryData));

    Set(
    varBase64Only,
    Mid(
    varDemoFromAttachControl,
    Find(",",
    varDemoFromAttachControl+1,
    Len(varDemoFromAttachControl) -
    Find(
    ",",
    varDemoFromAttachControl
    )-1
    )
    )
    );

    Set(
    varFileLink,
    FireandLifeSafetySystemAnnualInspectionUploaderFlow.Run(
    FandLSITMUploadFormGallery.Updates.Park &
    FandLSITMUploadFormGallery.Updates.AssetID &
    FandLSITMUploadFormGallery.Updates.DateofInspection,
    varBase64Only).sharepointfilelink);

     

    Here is a screenshot. The check box and dropdown are free floating. The large field is a Form. The Asset ID is auto-populated from another screen. There are several fields that are hidden, the content of which is being capture and updated in the Patch formula.

     

    Its really kicking and screaming about the Set(varDemoFromAttachControl, JSON(UploadAssistImageControl.Image, IgnoreBinaryData)); and Set(varBase64Only,Mid( varDemoFromAttachControl,..... lines. Like I said, most of that stuff is a cut a paste from an app where it is actually working in a patch. However, it may not be appropriate for this; not sure.

    3csman_0-1600144076392.png

     

  • Verified answer
    WarrenBelz Profile Picture
    155,279 Most Valuable Professional on at

    @Anonymous ,

    I did not try and edit your code, only looked for syntax errors. I have done a blog on this with code that may assist.

    Translating yours into it, something like this should work

    With(
     {
     wJSON: 
     JSON(
     UploadAssistImageControl.Image,
     JSONFormat.IncludeBinaryData
     )
     },
     Mid(
     wJSON,
     Find(
     ",",
     wJSON
     ) + 1,
     Len(wJSON) - 
     Find(
     ",",
     wJSON
     ) - 1
     ),
     Set(
     varBase64Only,
     wJSON
    )

    Please try and understand what it does It is described in the blog).

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ever the consistent mentor.

     

    Yes, I will review and attempt to digest and understand as much of the blog as I can before editing my formula. 😊

     

    Thank you,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,074

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 606

Last 30 days Overall leaderboard