Q:

how to read csv values using robot framework

How to read particular value based on key using robotframework
I am trying to read particular value from csv by passing the key parameter
file.csv-> has below items
Param_Name,Param_Value
res_name,res123
id_name,123

 robotfile.csv->
 ReadCSV
    [Arguments]       ${paramname}
    @{list}=  read csv file to list  ${CURDIR}${/}file.csv
    ${dict1}=    Set Variable     ${list}
    :FOR    ${node}    IN    @{dict1}
    \    Log To Console    ${node[1]}['${paramname'}]

 ${Read_Name}=    ReadCSV        res_name

expected:res123  Actual: None

A:

I created the following example based on your needs. The keyword will first create a list with a res_name and id_name (you can substitute your own way of fetching a CSV list here) and then returns the wanted field value to you and prints it.
*** Settings ***
Library  String

*** Keywords ***
ReadCSV
    [Arguments]       ${FIELD}
    @{LIST}=  Create List  res_name,res123    id_name,123
    :FOR   ${ITEM}   IN   @{LIST}
    \  @{FIELDS}=  Split String  ${ITEM}  ,
    \  Return From Keyword If  '${FIELDS[0]}' == '${FIELD}'  ${FIELDS[1]}
    [return]

*** Test Cases ***
Read CSV values
    ${NAME}=  ReadCSV  res_name
    Log To Console  res_name: ${NAME}
    ${ID}=  ReadCSV  id_name
    Log To Console  id_name: ${ID}

