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 to sharepoint, r...
Power Apps
Unanswered

Patch to sharepoint, replace image with blank

(1) ShareShare
ReportReport
Posted on by 407

Just trying to swap out signature with blank image if no signature is found. Can this be done in the patch section like below? (Image10 is the image i am trying to replace it with.

 

Patch(Malcolm, Defaults(Malcolm),{Signature1: If (IsBlank(CollectGallery.Selected.Signature2, CollectGallery.Selected.Image10});

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Matt383 ,

     

    You'd better provide more details about your scenario, especially the list and it's structure like columns with respective column type. I don't understand why there will be two signature columns (not to mention they could be the same) for one record, and there will be a blank image even more.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Matt383 Profile Picture
    407 on at

    Thanks for getting back to me. 

    I have two signatures (Signature1 and Signature2) , for customer and companyrep. The app first saves to a collection, 

     

    Collect(
    KBLMalcolm,
    {

    Signature1:Substitute(JSON(PenInput2.Image,IncludeBinaryData),"""",""),
    Signature2:Substitute(JSON(PenInput2_1.Image,IncludeBinaryData),"""",""),

    Image10:Substitute(JSON(Image10.Image,IncludeBinaryData),"""","")

    }

    )

    then once they are ready to submit to sharepoint, i have a submit button in the gallery

    Patch(Malcolm, Defaults(Malcolm),{Signature1: CollectGallery.Selected.Signature1,Signature2: CollectGallery.Selected.Signature2,Image10:CollectGallery.Selected.Image10});

    SaveData(KBLMalcolm."MalcolmKeep")

     

    I then have a flow with some html in compose that pulls the data into a pdf (See attached). Everything works as it should, with the exception of, if no signature is entered, then im left with a red X on the pdf where the signature would be. (like a broken link or Onerror) I have a blank image saved in powerapps called Image10 that i want to use to replace with in the event that no signature is entered.

    automate_flow.jpg
    automate_Compose.PNG
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Matt383 ,

     

    OK I understand now. So the point is even the peninput control is blank, you will still be able to get a JSON string for this blank image. IsBlank functio won't be able to know if there is no signature is given to the App.

     

    Please try below formula instead:

    Patch(
     Malcolm, Defaults(Malcolm),{Signature1: If(IsBlank(CollectGallery.Selected.Signature2, CollectGallery.Selected.Image10})
    Patch(
     Malcolm, 
     Defaults(Malcolm),
     {
     Signature1: If(
     EndsWith(
     CollectGallery.Selected.Signature1,
     "MgQOABYzEA52Z8YEEAAAAASUVORK5CYII="
     ), 
     CollectGallery.Selected.Image10,
     CollectGallery.Selected.Signature1
     ),
     Signature2: If(
     EndsWith(
     CollectGallery.Selected.Signature2,
     "MgQOABYzEA52Z8YEEAAAAASUVORK5CYII="
     ), 
     CollectGallery.Selected.Image10,
     CollectGallery.Selected.Signature2
     ),
     Image10: CollectGallery.Selected.Image10
     }
    );
    SaveData(KBLMalcolm."MalcolmKeep")

     

    "MgQOABYzEA52Z8YEEAAAAASUVORK5CYII=" is from the JSON string of a blank Pen Input control.

     

    Hope this helps.

     

  • Matt383 Profile Picture
    407 on at

    HI Jeffer,

     

    I just tried your formula, no errors, however same result. (see attached)

    Capture.PNG
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Matt383 ,

     

    Was this test with two blank signatures? Do you have an Image10 column in the SP list? You may need to check the result of using Image10 value in the Compose operation.

     

    Please have a try and I will wait for the result so that we can move on.

     

     

  • Matt383 Profile Picture
    407 on at

    Hi Jeffer, yes, no signatures entered.  I have checked the sharepoint list and there is a column Image10 and the image is coming across in sharepoint. Im not sure where i would list the image10 in the compose

    can i run an if null statement in compose with <td style="width: 120.3px;" colspan="2"><strong><img src="',variables('objectList')?['Signature1'],'" width="60" height="60" /></strong></td> 

  • Matt383 Profile Picture
    407 on at

    Hi Jeffer, yes, no signatures entered.  I have checked the sharepoint list and there is a column Image10 and the image is coming across in sharepoint. Im not sure where i would list the image10 in the compose

    can i run an if null statement in compose with <td style="width: 120.3px;" colspan="2"><strong><img src="',variables('objectList')?['Signature1'],'" width="60" height="60" /></strong></td> 

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Matt383 ,

     

    You can have a try but I don't think it's the solution. Could you please check if the JSON string of Image10 is end with "MgQOABYzEA52Z8YEEAAAAASUVORK5CYII=" on your end?

     

  • Matt383 Profile Picture
    407 on at

    This is how image10 is displayed in sharepoint data&colon;image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAMAAAAPkIrYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkFGMzc2MkFDMThDRjExRUJBNDVBREY4MTg0QjgzMkMyIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkFGMzc2MkFEMThDRjExRUJBNDVBREY4MTg0QjgzMkMyIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QUYzNzYyQUExOENGMTFFQkE0NUFERjgxODRCODMyQzIiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QUYzNzYyQUIxOENGMTFFQkE0NUFERjgxODRCODMyQzIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6RoGuZAAAABlBMVEX///8AAABVwtN+AAAAH0lEQVR42uzBgQAAAADDoPlTX+AIVQEAAAAAwDcBBgAWRAABGi1TOgAAAABJRU5ErkJggg==

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Matt383 ,

     

    Sorry my bad. I need to check if the JSON string of the two blank signatures are end with "MgQOABYzEA52Z8YEEAAAAASUVORK5CYII=" in the collection "KBLMalcolm"

     

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!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard