cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Selom
Helper I
Helper I

Send http request to make SharePoint event is not working and conditions not working

Hi all,

Update: even though I asked here, my hyperfocus was already on and I couldn't let go. I finally realised my dodo brain put 'EventEnd' instead of 'ENDDATE'!!!!!!! So please could you help me with my second question:

 

Another question I have is, I added a condition to check if the date columns are empty so that it would ignore that row if it was. it's just date is not equal to null (using expression) but it fails out each empty row. What I do wrong there?

Selom_2-1701787232041.png

 

My 2nd question is, can I feed in the banner URL via this too? (Update: I answered this by going to my original Create Item flow to get the JSON. I couldn't get the right word combo in Google to get the name, it's "BannerImageUrl", however, it doesn't do it, do I need to add anything else to help trigger it?)

 

Ok, I have a 3rd problem. The calendar item adds and then they disappear.

 

Thanks for any help.

 

I have read loads of articles and watched 1 video but for some reason (incompetence) I cannot wrap my head around my error.

 

I created a manual trigger to just read an Excel table and created the items fine. My only issue was that there was no 'All day' option.

 

I found the solution is to create the event via http request instead.

 

I thought I did it all, but each attempt to fix it produces a new error. I mixed single and double quotation so I moved to just single, I created a new calendar because I prefer it under 'Birthdays' but that wasn't being recognised so changed it back to Events.

 Error message: "status": 400,
  "message": "A type named 'SP.Data.EventsListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type. 

 

Moved from nometadata to verbose... changed obvious typos in between crying sessions...

 

What am I doing wrong?

Selom_1-1701787122133.png

 

{
'__metadata': { 'type': 'SP.Data.EventsListItem' },
'Title': '@{items('Apply_to_each')?['Name']}',
'fAllDayEvent': 'true',
'EventDate': '@{items('Apply_to_each')?['Birthday start']}',
'EventEnd': '@{items('Apply_to_each')?['End']}'
}

 

 

 

4 REPLIES 4
eliotcole
Super User
Super User

I have made calendar events recently, @Selom ... let me just see what I used there, as they appear to be working just fine. 👍

 

---

 

OK, I'm going to make a guess that your dates are not formatted correctly. So the list items actually do exist, but the dates you are inputting are not helping, perhaps.

 

That's just a guess, mind.

 

---

 

Either way, hopefully using my method might help you slip those events in there.

 

Firstly, I keep the site Events list ID in the 'eventsListIdVAR' string variable. This allows me to force the Create item action to do my bidding! 😈

 

Then I use the Create item SharePoint action with that variable as a Custom value in the List name field below the Chosen Site Address.

 

I have already built my JSON body in the 'createEventBodyObjVAR' object variable prior to this. It ends up looking something like this:

{
  "Category": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    "Id": 0,
    "Value": "Meeting"
  },
  "Title": "EVENT_TITLE",
  "EventDate": @{variables('eventDateVAR')},
  "EndDate": "END_DATE"
}

Prior to building that I format my dates (for example the above "eventDateVAR" string variable) with the following function/expression:

formatDateTime(triggerOutputs()?['body/DueDate'], 'o')

That puts the date in the correct format to submit, I can add additional properties if needed later in the flow.

 

Hope that this helps!

 

---

 

Perhaps all you need to do is reformat your dates, though ... try changing the direct references to the dates with formatDateTime() functions wrapping around those values in place.

 

---

 

Also, and this is completely out there ... perhaps try it with double quote in place of your single quotes.

Hi Eliot,

 

Thanks for your message. I already figured out how to make them (that's the stricken out part).

 

My issues are:

  • I can't get the bannerimage to trigger. I managed it once, didn't realise it worked and then changed it and now can't remember what I did to make it work.
  • I am using conditions to skip empty rows but instead of accepted the criteria I made, it instead fails each empty row, so my whole thing "fails" but in reality every TRUE item is fine, but I don't want to have my flow as failed status. I'm not sure why it's failing because it's a simple binary option, not null TRUE or null FALSE.
  • My 3rd problem isn't happening anymore.
eliotcole
Super User
Super User

OK, I was addressing the 3rd part.

 

I would suggest that you tackle each of your issues one by one. However if you take my approach you might resolve a few of them. Either way, good luck!

Oh I see, thank you. I could not identify where in the step it lets me have the 'All day' setting toggled on and have the photo in? From the error message and raw JSON, it seems to recognise the date fine.

 

I think for now I will just keep a table that only has values in it so that I don't need the conditions then.

 

Thanks again.

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,510)