cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

[CSDK] Update row on Infotabe

AliBenBelgacem
14-Alexandrite

[CSDK] Update row on Infotabe

Hello,

 

I want to update a row in an infotable in my CSDK

I have an infotable  i am iterating via twList_Foreach

my infotable contain sevaral fields : Id, field A, field B, field C

I want to iterate my infotable row by row if i found the id already exist, i have to update the fields (A, B, C)

This my code:

twList_Foreach(it_List, search_ForeachHandler, params)

in the param i am passing the id to serach

in my search_ForeachHandler:

static int search_ForeachHandler(void* key, size_t keySize, void* currentValue, void* userData) {
	twInfoTableRow* value = (twInfoTableRow*)currentValue;
	//id to search
	int*  id= (int*)userData;
	
	if (*id == twInfoTableRow_GetEntry(value, 0)) { 
		//Get Field A
		twPrimitive* it_field_a = twInfoTableRow_GetEntry(value, 1);
		it_field_a = TW_MAKE_STRING(params->message_id);
//Same for field B et C ....
		return TW_FOREACH_EXIT;
	}	
	return TW_FOREACH_CONTINUE;
}

I thought I am modifying row field by address. but apparently it's a copy.

Do you have an idea how to update field in the row of an infotable.

Thank you for your help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

You could remove and re-add the row, or maybe twList_ReplaceValue could be of help?

Rocko_0-1705067899952.png

 

View solution in original post

1 REPLY 1

You could remove and re-add the row, or maybe twList_ReplaceValue could be of help?

Rocko_0-1705067899952.png

 

Top Tags