cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jade7669
Advocate I
Advocate I

PowerApps using CDS to create CRM record with Lookup filled by pre-collected data

I am in the process of updating Data source of an existing PowerApps.  It's previously built with D365 but now I need to change it to CDS.  While working on this, I was not able to create new record (with complete data) in CRM when using SubmitForm function.  It's always missing the Lookup field data, and the GUID for the Lookup field is collected on the previous screen.  I found some examples to use Patch function instead and it works; however, I am also required to include all other CRM fields in Patch, plus I need to reset the fields and redirect to screen, all which SubmitForm function would've done for me in 1 line of code.  So I would like to find out: is using Patch function the best practice, or is there a better and less messy way to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
poweractivate
Most Valuable Professional
Most Valuable Professional

@jade7669 

 

Try simply to have the Combo Box "DefaultSelectedItems" property set to:

 

Filter(Contacts, Contact = GUID(Label1.Text))

 

Where:

Substitute "Label1" with your label that has that GUID on it

Substitute "Contacts" with your data source from CDS

And Contact being probably the same in your case

 

See image below as well for test result success:

 

DefaultSelectedItemsSetToLabelGuidRef.png
And when Contact B is selected from Gallery to test:

 

DefaultSelectedItemsSetToLabelGuidRef2.png

 

Notice also, GUID are slightly different in both images above.

 

 

View solution in original post

8 REPLIES 8
poweractivate
Most Valuable Professional
Most Valuable Professional

@jade7669 

 

You should be able to use SubmitForm with CDS data source. In fact, we often found CDS as the best connector.

 

You are converting from Dynamics connector to CDS. You may need to check more carefully the guid collected in previous screen you mentioned. Make sure the data source is changed everywhere, it may be easy to forget a few and it is still referencing the now invalid data source.

 

Also, if you are not doing it already, you should completely remove the Dynamics 365 data source  (in a new dev copy of the app) and make it so it shows Formula errors every time you are still using the Dynamics 365 data source. It is possible you're using both at same time, which is not good even if the app for some reason "works" with both data sources in there. When you are migrating, you need to cleanly remove the Dynamics 365 source in a dev copy, in the meantime the live version should use Dynamics 365 until you are ready with a completely migrated CDS data source version of the PowerApp.

 

Also, we recommend you do not attempt to keep the same name of the data source as the old one. Recommend you make a new data source, do not attempt to force it to take the old name, make sure red X's show up, and go manually change everywhere the old name is to the new name and review each function manually for any relevant changes.

Thank you for your quick response, @poweractivate !!

 

1) previous I have used a text field in PowerApps to capture the contactid from the previous screen.  When I use SubmitForm function with CDS, it shows error 'value must be a data entry record' under the text field and would not create CRM record (see attached image).  Could you please give me guidance on how to overcome this error?

 

2) because I have other apps in the same environment using D365 Data source, I am not able to remove this Data source just yet.  However, I can see from this app, all the Data source shows CDS and not D365.  Would this be sufficient to what you are referring to?

 

3) when I changed the Data source from D365 to CDS (by removing the D365 data sources and then add the CDS data sources), it doesn't give me an option to rename the data sources, and the new ones happen to be in the same name as the discarded ones.  Not sure what to do here?!

 

Thank you.

 

Jessica

poweractivate
Most Valuable Professional
Most Valuable Professional

@jade7669 

 

  1. The schema of CDS Connector has a subtle difference to D365 Connector in how you are using it. Can you go to the Stethoscope Icon and check if there are any other errors before submitting the form and post details here? Especially those errors under "Formulas" Subcategory
  2.  Please do not remove the data source from all places in the tenant, and please do not remove it from the production app. Instead, please make a clone of the app first that nobody is using (using Save As), with a new name, and only remove the data source from that single cloned dev app. That is what we meant when we said it first.
  3. Then let's leave that alone, but the error may be harder to find, so try #1 first and check for any other errors.
  4. Wild guesses on the issue:
    1. Somewhere in the app you may need to reference the CDS column in another way, such as using the 'Column Display Name' instead of Logical name, but again that depends what's the real cause in your case - so we would need to be sure of what is the specific error in your case.

Yes I have cloned the original PowerApp to a new one under the same environment and then remove old data source and add new CDS data source.  So we are safe there!!  I have followed the instruction to make sure Settings is configured correctly for CDS.

 

Unfortunately there is no other error under Formulas in this case (see attached image)!  I have resolved all other issues or errors that had come up during this process.  One thing to mention, I am re-using all fields and layout from the existing PowerApps, so as you can see from the attached image, that custom field is with Guid number in the text field, and that's how it worked in the original app with D365.  If I were to remove and re-add that field, it would turn into a drop-down list, which I am also not able to figure out as to how to insert the pre-collected data (Guid) to save in CRM.

 

Please advise.

 

Thank you.

poweractivate
Most Valuable Professional
Most Valuable Professional

@jade7669 

 

Instead of a hard GUID are you allowed to just use a ComboBox instead and have someone select the Contact?

Or is this not allowed in your business requirements?

You are correct, due to business logic, we have created a previous page that shows a collections of Contacts that the logged in user owns and follows.  Given this is a project to fix up just the Data source, I am hoping that we keep the original screen flow unless I absolutely needs to modify.  So how would you set the selected value of the combo box if you know the Guid and still able to write to CRM correctly?

poweractivate
Most Valuable Professional
Most Valuable Professional

@jade7669 

 

Try simply to have the Combo Box "DefaultSelectedItems" property set to:

 

Filter(Contacts, Contact = GUID(Label1.Text))

 

Where:

Substitute "Label1" with your label that has that GUID on it

Substitute "Contacts" with your data source from CDS

And Contact being probably the same in your case

 

See image below as well for test result success:

 

DefaultSelectedItemsSetToLabelGuidRef.png
And when Contact B is selected from Gallery to test:

 

DefaultSelectedItemsSetToLabelGuidRef2.png

 

Notice also, GUID are slightly different in both images above.

 

 

I have marked your last reply as the solution for my post!

Thank you again for your help!!

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

  It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd. at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3rd, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!       Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪🌠

Tuesday Tips: Community Ranks and YOU

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!This Week: Community Ranks--Moving from "Member" to "Community Champion"   Have you ever wondered how your fellow community members ascend the ranks within our community? What sets apart an Advocate from a Helper, or a Solution Sage from a Community Champion? In today’s #TuesdayTip, we’re unveiling the secrets and sharing tips to help YOU elevate your ranking—and why it matters to our vibrant communities. Community ranks serve as a window into a member’s role and activity. They celebrate your accomplishments and reveal whether someone has been actively contributing and assisting others. For instance, a Super User is someone who has been exceptionally helpful and engaged. Some ranks even come with special permissions, especially those related to community management. As you actively participate—whether by creating new topics, providing solutions, or earning kudos—your rank can climb. Each time you achieve a new rank, you’ll receive an email notification. Look out for the icon and rank name displayed next to your username—it’s a badge of honor! Fun fact: Your Community Engagement Team keeps an eye on these ranks, recognizing the most passionate and active community members. So shine brightly with valuable content, and you might just earn well-deserved recognition! Where can you see someone’s rank? When viewing a post, you’ll find a member’s rank to the left of their name.Click on a username to explore their profile, where their rank is prominently displayed. What about the ranks themselves? New members start as New Members, progressing to Regular Visitors, and then Frequent Visitors.Beyond that, we have a categorized system: Kudo Ranks: Earned through kudos (teal icons).Post Ranks: Based on your posts (purple icons).Solution Ranks: Reflecting your solutions (green icons).Combo Ranks: These orange icons combine kudos, solutions, and posts. The top ranks have unique names, making your journey even more exciting! So dive in, collect those kudos, share solutions, and let’s see how high you can rank! 🌟 🚀   Check out the Using the Community boards in each of the communities for more helpful information!  Power Apps, Power Automate, Copilot Studio & Power Pages

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

Top Solution Authors
Top Kudoed Authors
Users online (5,147)