Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7033259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:02:36+00:00 2026-05-28T01:02:36+00:00

In my code I have received, by way of a url, a comma delimited

  • 0

In my code I have received, by way of a url, a comma delimited list of id’s e.g.

12,13,14,15,16 etc..

I have got these into a string (Tools) which I have Split.

I now need to loop through each value and use it in an insert statement but I have got stuck can anyone help.

The C# below is based on an SDK so it is uses some functions that you may not have seen.

string userc = GetContextInfo("User", "UserId");
string tools = Dispatch.EitherField("selectedTools");
tools.Split(',');

string pID = Dispatch.EitherField("key16");

Record recRelTool = new Record("RelatedTools");
recRelTool.SetField("rato_CreatedBy", userc);
recRelTool.SetField("rato_Status", "active");
recRelTool.SetField("rato_server", pID);
recRelTool.SetField("rato_tool", tools);
recRelTool.SaveChanges();
Dispatch.Redirect(Url("1453"));

Where the ("rato_tools", tools) needs to be one of the tool id’s in the value I have. I need to loop through until all of the tool id’s have been used.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:02:36+00:00Added an answer on May 28, 2026 at 1:02 am

    The call to split does not split your string, it returns an array of strings. You need to enumerate through this array to use one tool id at a time. Try the following:

    string userc = GetContextInfo("User", "UserId");
    string tools = Dispatch.EitherField("selectedTools");
    string[] toolIds = tools.Split(',');
    foreach (string toolId in toolIds) 
    {
      Record recRelTool = new Record("RelatedTools");
      recRelTool.SetField("rato_CreatedBy", userc);
      recRelTool.SetField("rato_Status", "active");
      recRelTool.SetField("rato_server", pID);
      recRelTool.SetField("rato_tool", toolId);
      recRelTool.SaveChanges();
    }
    
    Dispatch.Redirect(Url("1453"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code that generates a List<string[]> variable but can't quite figure out how
I have code which has a drop down list. And when a certain option
I have some code which connects to a URL to download a file, and
I have this piece of coding which is supposed to receive a URL as
I have this AS3 slideshow code, that loads an XML with a list of
I have the following code, using Crockford's json2 to parse the object into json
I have the following code, I receive an error at if statement saying that
this is function.php of a wordpress theme that NOD32 says this code have a
Code I have written involves getting the time waiting for 10 minutes and then
I have code like this in my view model: function ChatListViewModel(chats) { var self

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.