cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AFE2E
Regular Visitor

Base64 string and JSON format

Good afternoon, 

 

On the last screen of my Powerapp, I submit data from the previous screens using a flow. The user can take photos in the app, which are saved in to a collection as base64 strings. If I don't take a photo, my JSON payload looks like the image below. All fields etc are in the correct place.

AFE2E_0-1627481556176.png

However, if I take one photo and save it to the collection before submitting the payload, it completely changes my JSON schema, as below...

 

AFE2E_1-1627481726356.png

 

The code to submit the JSON is below... The line that seems to mess it up is in the Attachments table 'documentBase64: CameraPhotos.Base64String,'

 

ForAll(
    Gallery4.AllItems,
    Collect(
        SubmitAuditRequest,
        {
            results: [
                {
                    questionKey: Value(lblQKey.Text),
                    successCriteriaMet: txtQSCM.Text,
                    addToActionPlan: false,
                    additionalComments: txtQComments.Text,
                    typeCode: lblQTypeCode.Text,
                    additionalQuestionText: lblQAdditionalQuestionText.Text,
                    score: txtQGrade.Text,
                    actions: [
                        {
                            parentKey: Value(lblQKey.Text),
                            parentTypeCode: "RECORD_PARENT_TYPE_##3",
                            action: txtQActions.Text,
                            dateRequired: txtQActionDue.Text,
                            assignedToKey: LblQUserKey.Text,
                            statusCode: "ACTION_STATUS_TYPE_##1",
                            priorityCode: "PRIORITY_TYPE_##3"
                        }
                    ],
                   
                    attachments: [
                        {
                            parentKey: Value(lblQKey.Text),
                            parentTypeCode: "RECORD_PARENT_TYPE_##3",
                            documentBase64: CameraPhotos.Base64String,
                            name: "New Image",
                            extension: "img",
                            attachmentTypeCode: "RECORD_DOCUMENT_TYPE_##1"
                        }
                    ]
                }
            ],
            organisationKey: userSettings.OrganisationKey,
            name: "TestAudit",
            typeCode: AuditTypeCode,
            statusCode: "AUDIT_STATUS_TYPE_##1",
            auditors: LearningWalk.StaffLead,
            auditDate: Text(
                Today(),
                "yyyy-mm-dd"
            ),
            staffLeadList: LearningWalk.StaffLead,
            areas: LearningWalk.Location,
            staffList: LearningWalk.StaffNames,
            focusArea: LearningWalk.Focus,
            focusSubArea: SubAreaArray,
            successCriteria: LearningWalk.SuccessCriteria,
            comment: LearningWalk.Comments,
            Key: 0,
            userKey: LearningWalk.CreatedBy,
            IsActive: true
        }
    );
    
);

Can anyone assist me?

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @AFE2E ,

How are you submitting this information to Power Automate, and how is the Flow configured to receive information from PowerApps?

On the face of it, it looks like the row data is being submitted as a string - are you intending to pass a JSON construct of your full collection to Flow, or the result of a single row lookup (or something)?

Kind regards,

RT

View solution in original post

2 REPLIES 2
RusselThomas
Microsoft
Microsoft

Hi @AFE2E ,

How are you submitting this information to Power Automate, and how is the Flow configured to receive information from PowerApps?

On the face of it, it looks like the row data is being submitted as a string - are you intending to pass a JSON construct of your full collection to Flow, or the result of a single row lookup (or something)?

Kind regards,

RT

View solution in original post

Hi

 

Thanks, I managed to work it out in the end. I didn't want to pass as a string...that's where the issue was.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,623)