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 / Can't create JSON obje...
Power Apps
Answered

Can't create JSON object to pass form data

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

 

I am creating a powerap that I intend to use with a flow triggered by a button in the app. I have the OnSelect property of the button set to;

Collect(
 FormInfo,
 {
 SiteTitle: SiteTitle.Text,
 SiteDescription: SiteDescription.Text,
 SiteAddress: SiteAddress.Text,
 SiteOwner: SiteOwner.SelectedItems,
 SiteTemplate: SiteTemplate.SelectedText 
 }
);

Set(
 FormObj,
 JSON(FormInfo));

How every it doesn't seem to like the the collection name. I've tried many others but same issue, I can't see where the syntax is incorrect. Anyone experience this, How can I achieve this.

 

I appreciate any assistance I can get.

 

Thank you,

DWTKBrook

Categories:
  • Verified answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @Anonymous 

     

    The error I was getting was 

    SpongYe_0-1694812445198.png

     

    By adding .Value to SiteTemplate solved my issue:

    Collect(
     FormInfo,
     {
     SiteTitle: SiteTitle.Text,
     SiteDescription: SiteDescription.Text,
     SiteAddress: SiteAddress.Text,
     SiteOwner: SiteOwner.SelectedItems,
     SiteTemplate: SiteTemplate.SelectedText.Value //Added .Value
     }
    );
    
    Set(FormObj, JSON(FormInfo));

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    DOH! @SpongYe Thank you so much, that did it!

    Cheers!

    DWTKBrook

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard