If I get input value as powerpoint ,i need to get output as PowerPoint.please find the attached photo.
Hey @sruthesanju
-
Read your excel table into a
DataTable
variable asdt_Config
-
Assuming your input string variable as
inputStringVar
-
Below is the code to fetch keyword value based on the name column value received in the input string variable
dt_Config.AsEnumerable.Where(Function(row) row("Name").ToString.Equals(inputStringVar)).First().Item("Keyword").ToString.Trim
Hope this helps
Thanks
#nK
If I get any value from keyword column .I need to get value from name column
Hey @sruthesanju
Please find the updated one…
dt_Config.AsEnumerable.Where(Function(row) row("Keyword").ToString.Contains(inputStringVar)).First().Item("Name").ToString.Trim
Thanks
#nK
I have tried this one ,I am getting the error as Sequence contains no element
It means the input string you passed has no match.
Whats the input value you passed?
#nK
Power Point which is there in keyword column
Are you passing the exact word, If you pass with space and different case it will cause issue.
Just updated the statement below to handle spaces and also case insensitive if this is relevant for you
dt_Config.AsEnumerable.Where(Function(row) row("Keyword").ToString.ToLower.Contains(inputStringVar.ToLower.Replace(" ",""))).First().Item("Name").ToString.Trim
Thanks
#nK
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.