Skip to main content

C# string formatting problems

  • March 1, 2022
  • 3 replies
  • 2227 views

Hello

I am having a few problems formatting a json string for a C# query I am making

@"{""query"": ""query { items_by_multiple_column_values (board_id: 1234, column_id: \\""text0\\"", column_values: [\\""something,something_else\\""] ) {id}"" }";

Here is a little example of the string. I have tried formatting it with JsonConvert.SerializeObject to no avail.

Any help would be much appreciated.

This topic has been closed for replies.

3 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 2, 2022

Hello @Will!

Being transparent with you, I do not have experience with C#, but maybe this post, or this one might help 🙂

Cheers,
Matias


  • Author
  • New Participant
  • March 2, 2022

Hey @Matias.Monday.

Thanks for the help. While the links were useful, I managed to find an example that worked quite well on stack overflow : https://stackoverflow.com/questions/70717201/monday-com-restsharp-api-request.

The accepted solution worked wonders for me. Thank you very much.

P.S. Here is the block that worked, should it help anyone else :

var call = JsonConvert.SerializeObject(
                new
                {
                    query = "query { items_by_multiple_column_values (board_id: 1234, column_id: \\"text0\\", column_values: [\\"something\\",\\"somethingElse\\"] ) {id column_values(ids: \\"text0\\"){value} } }"
                }
    );

Uses Newtonsoft.Json


  • March 9, 2022

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.